package com.hh.test.design.prototype;

import java.util.Arrays;

public class Prototype {
	public static void main(String[] args) {
		Student stu = new Student();
		stu.setName("s");
		Teacher t = new Teacher();
		t.setName("b");
		t.setList(Arrays.asList(stu));
		try {
			Teacher t2 = t.clone();
			t.getList().get(0).setName("a2");
			System.out.println(t2);
			System.out.println(t);
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}

	}
}
